**Last edited ARIL 22, 2019
*All analyses conducted with Stata IC 15.1 


//Main analyses:


*SSA (Sub Saharan Africa sample); Afr (Africa sample); Full (Full sample with Africa and Middle East)


*In article tables
eststo clear

eststo: quietly melogit inci_com exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum250 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum75 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


esttab using tableA001.tex, order(exGWmeanfln 1.exGW_dum250 1.exGW_dum75 1.exwaterbody_dum l1_i_prec_gpcp_Ln 1.l1_drought_ebas ) eform b(3) se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 



*Full model tables (See Supplementary Material)
eststo clear

eststo: quietly melogit inci_com exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum250 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum75 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


esttab using table001.tex, eform b(3) se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 


//Interactive models  (See Supplementary Material)

*Drought
eststo clear

eststo: quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com exGWmeanfln c.exGWmeanfln#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com exGWmeanfln c.exGWmeanfln#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum75 i.GW_dum75#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.GW_dum75#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL  i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.GW_dum75#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


esttab using table002.tex, eform b(3)   se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 


*Precipitation (See Supplementary Material)
eststo clear

eststo: quietly melogit inci_com GWmeanfLn  c.GWmeanfLn#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com GWmeanfLn c.GWmeanfLn#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com GWmeanfLn c.GWmeanfLn#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL  i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum75 i.exGW_dum75#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exGW_dum75#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exGW_dum75#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


esttab using table003.tex, eform b(3)  se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 



*Population Density (See Supplementary Material)
eststo clear

eststo: quietly melogit inci_com GWmeanfLn  c.GWmeanfLn#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com GWmeanfLn c.GWmeanfLn#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com GWmeanfLn c.GWmeanfLn#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum250 i.exGW_dum250#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


eststo: quietly melogit inci_com i.exGW_dum75 i.exGW_dum75#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum  i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exGW_dum75#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or

eststo: quietly melogit inci_com i.exGW_dum75 i.exGW_dum75#c.l1_i_pop_gpw_dens_Ln i.l1_drought_ebas i.waterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln  l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


esttab using table004.tex, eform b(3)  se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 




//Marginal Effects

**Graph2b

eststo clear
quietly melogit inci_com exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or
margins, at(exGWmeanfln=(0.5(0.5)7.5)) atmeans post
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram exGWmeanfln if exGWmeanfln>=0.5 & exGWmeanfln<=8,  bcolor(none) yaxis(2)) legend(off)



***For interactive model with Groundwater ln and Precipitation (Fig. 4)

**SSA
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at(c.l1_i_prec_gpcp_Ln=(1(0.5)8.0) (means)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l1_i_prec_gpcp_Ln if l1_i_prec_gpcp_Ln>=1 & l1_i_prec_gpcp_Ln<=8 & SSA,  bcolor(none) yaxis(2)) legend(off)

**Full
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1_i_prec_gpcp_Ln i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100|| gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at(c.l1_i_prec_gpcp_Ln=(1(0.5)8.0) (means))
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l1_i_prec_gpcp_Ln if l1_i_prec_gpcp_Ln>=1 & l1_i_prec_gpcp_Ln<=8,  bcolor(none) yaxis(2)) legend(off)


***For interactive model with Precipitation and Groundwater ln  (See Supplementary Material)

**SSA
quietly melogit inci_com exGWmeanfln  c.l1_i_prec_gpcp_Ln#c.exGWmeanfln i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(c.l1_i_prec_gpcp_Ln) at(exGWmeanfln=(0(0.5)6) (means)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram exGWmeanfln if exGWmeanfln>=0 & exGWmeanfln<=6 & SSA,  bcolor(none) yaxis(2)) legend(off)

**Full
quietly melogit inci_com exGWmeanfln  c.l1_i_prec_gpcp_Ln#c.exGWmeanfln i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100|| gid: , intpoints(10) or
margins, dydx(c.l1_i_prec_gpcp_Ln) at(exGWmeanfln=(0(0.5)6) (means)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram exGWmeanfln if exGWmeanfln>=0 & exGWmeanfln<=6,  bcolor(none) yaxis(2)) legend(off)




***For interactive model with Groundwater ln and Population density (Fig. 5)

**SSA
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1_i_pop_gpw_dens_Ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) c.l1_i_pop_gpw_dens_Ln=(.2(0.5)6.2)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l1_i_pop_gpw_dens_Ln if l1_i_pop_gpw_dens_Ln>=.2 & l1_i_pop_gpw_dens_Ln<=6.2 & SSA,  bcolor(none) yaxis(2)) legend(off)

**Full
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1_i_pop_gpw_dens_Ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100|| gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) c.l1_i_pop_gpw_dens_Ln=(.2(0.5)6.2))
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l1_i_pop_gpw_dens_Ln if l1_i_pop_gpw_dens_Ln>=.2 & l1_i_pop_gpw_dens_Ln<=6.2,  bcolor(none) yaxis(2)) legend(off)


***For interactive model with Groundwater ln and Drought [dummy variable]  (See Supplementary Material)

**SSA
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(i.l1_drought_ebas) at(exGWmeanfln=(0(0.5)9.5)) at(spline_com=5) at(spline_com_Sq=25) at(spline_com_Cu100=1.25)  atmeans post
estimates store d3
coefplot d3 , at recast(line)lwidth(*2) yline(0) ciopts(recast(rline)lpattern(dash))


**Full
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#i.l1_drought_ebas i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100|| gid: , intpoints(10) or
margins, dydx(i.l1_drought_ebas) at(exGWmeanfln=(0(0.5)9.5)) at(spline_com=5) at(spline_com_Sq=25) at(spline_com_Cu100=1.25) atmeans post
estimates store d2
coefplot d2 , at recast(line)lwidth(*2) ciopts(recast(rline)lpattern(dash))





***Robustness Tests with Agricultural dependence (See Supplementary Material)


eststo clear

eststo: quietly melogit inci_com li_agri_ih exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com li_agri_ih exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or

eststo: quietly melogit inci_com li_agri_ih exGWmeanfln c.li_agri_ih#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or

eststo: quietly melogit inci_com li_agri_ih exGWmeanfln  c.li_agri_ih#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or


esttab using table005.tex, eform b(3)  se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 


quietly melogit inci_com li_agri_ih exGWmeanfln c.li_agri_ih#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) li_agri_ih=(0(10)100))
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram  li_agri_ih if  li_agri_ih>=0 & li_agri_ih<=100 & SSA,  bcolor(none) yaxis(2)) legend(off)


quietly melogit inci_com li_agri_ih exGWmeanfln  c.li_agri_ih#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) li_agri_ih=(0(10)100))
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram  li_agri_ih if  li_agri_ih>=0 & li_agri_ih<=100,  bcolor(none) yaxis(2)) legend(off)


***Robustness Tests with other versions of state presence

*For interactive model with Groundwater ln and Nightlight emissions

**SSA (See Supplementary Material)

eststo clear

eststo: melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1i_nlights_calmean_ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
eststo: melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1i_nlights_calmean_ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if Afr || gid: , intpoints(10) or
eststo: melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1i_nlights_calmean_ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 || gid: , intpoints(10) or

esttab using table007.tex, eform b(3)  se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 


*Graphs

**SSA  (See Supplementary Material)
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1i_nlights_calmean_ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) c.l1i_nlights_calmean=(-4.5(0.5)-1)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l1i_nlights_calmean if l1i_nlights_calmean>-4.5 & l1i_nlights_calmean<=-1 & SSA,  bcolor(none) yaxis(2)) legend(off)

**Full  (Figure 6)
quietly melogit inci_com exGWmeanfln  c.exGWmeanfln#c.l1i_nlights_calmean_ln  i.l1_drought_ebas i.exwaterbody_dum i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_temp l1_i_prec_gpcp_Ln l1_i_gcp_ppp_Ln l1_i_pop_gpw_dens_Ln i.l_civil_act_inci_SL i.l1_statebas i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) c.l1i_nlights_calmean=(-4.5(0.5)-1)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l1i_nlights_calmean if l1i_nlights_calmean>-4.5 & l1i_nlights_calmean<=-1,  bcolor(none) yaxis(2)) legend(off)



 
*with Vdem Property Rights (See Supplementary Material)
eststo clear

eststo: quietly melogit inci_com l_v2xcl_prpty exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA  || gwno: || gid: , intpoints(10) or

eststo: quietly melogit inci_com l_v2xcl_prpty exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gwno: || gid: , intpoints(10) or vce(cluster gwno)

eststo: quietly melogit inci_com l_v2xcl_prpty exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 || gwno: || gid: , intpoints(10) or

eststo: quietly melogit inci_com l_v2xcl_prpty exGWmeanfln c.l_v2xcl_prpty#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gwno: || gid: , intpoints(10) or

eststo: quietly melogit inci_com l_v2xcl_prpty exGWmeanfln  c.l_v2xcl_prpty#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100  || gwno: || gid: , intpoints(10) or


esttab using table006.tex, eform b(3)  se(3) star(+ .1 * .05 ** .01 *** .001) scalars(bic) label title(Communal Violence) compress replace 


*Graphs:

*Interactive model with Vdem property rights (See Supplementary Material)
melogit inci_com l_v2xcl_prpty exGWmeanfln c.l_v2xcl_prpty#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 if SSA || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) c.l_v2xcl_prpty=(0(.25)1)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l_v2xcl_prpty if l_v2xcl_prpty>=0 & l_v2xcl_prpty<=1 & SSA,  bcolor(none) yaxis(2)) legend(off)


*Interactive model with Vdem property rights (Figure 6)
quietly melogit inci_com l_v2xcl_prpty exGWmeanfln  c.l_v2xcl_prpty#c.exGWmeanfln i.exwaterbody_dum i.l1_drought_ebas i.l1_excluded_dum l1i_nlights_calmean_ln l1_i_gcp_ppp_Ln l1_i_prec_gpcp_Ln l1_i_temp l1_i_pop_gpw_dens_Ln i.l1_statebas i.l_civil_act_inci_SL i.l_com_dum_inci_SL spline_com spline_com_Sq spline_com_Cu100 || gid: , intpoints(10) or
margins, dydx(c.exGWmeanfln) at((means) c.l_v2xcl_prpty=(0(.25)1)) 
marginsplot, scheme(s2mono) recast(line) recastci(rarea) ylin(0) addplot(histogram l_v2xcl_prpty if l_v2xcl_prpty>=0 & l_v2xcl_prpty<=1 ,  bcolor(none) yaxis(2)) legend(off)

